<script setup lang="ts">
    import {ref,reactive} from 'vue'
    let age = ref()
    //接受父组件传过来的数据
    defineProps(['modelValue','uname','sage'])
    //定义一个自定义事件
    const emits = defineEmits(['update:modelValue','update:uname','update:sage'])
</script>
<template>
    <h3>v-model-子组件-{{ uname }}-{{ sage }}</h3>
    <input type="text" :value="modelValue" @input="emits('update:modelValue',(<HTMLInputElement>$event.target).value)">
    <hr>
    <input type="text" :value="uname" @input="emits('update:uname',(<HTMLInputElement>$event.target).value)">
    <input type="text" :value="sage" @input="emits('update:sage',(<HTMLInputElement>$event.target).value)">

    <!-- <input type="text" v-model="uname"> -->
</template>
<style scoped>
   
</style>